#pragma once

#include "CommonDefine.h"
#include "NetworkIDObject.h"

class CChatServerDoc;

class CChatRoom :
	public NetworkIDObject
{
	CString					m_roomName;
	typedef std::vector<RakNetGUID> JOINED_USER_CONTAINER;
	JOINED_USER_CONTAINER	m_joinedUserContainer;
	CChatServerDoc*		m_pChatServerDoc;
public:
	CChatRoom(void);
	virtual ~CChatRoom(void);

	void SetRoomName(CChatServerDoc& doc, const TCHAR* pRoomName);
	void			EnterRoom(const RakNetGUID& userGuid);
	void ExitRoom(const RakNetGUID& userGuid);
	bool			IsExistUser(const RakNetGUID& userGuid);
	void 			SendMessageForJoiningUserToEvenryOne(const RakNetGUID& joiningUserGuid);
	void 			SendMessageForJoinedUsersToJoiningUser(const RakNetGUID& joiningUserGuid);
	CString&		GetRoomName();
};
